/**
 * Copyright (C), 2001-2031, www.bosssof.com.cn
 * FileName: RegisterController.java
 * Author: shixianwei
 * Date: 2024/8/16 14:55
 * Description:
 * <p>
 * History:
 * Date          Author   Version  Desc
 * 2024-01-01    bosssoft  1.0.0   initialize this file
 */
package com.bosssoft.setp.controller;

import com.bosssoft.setp.pojo.dto.LoginDTO;
import com.bosssoft.setp.pojo.dto.RegisterDTO;
import com.bosssoft.setp.pojo.vo.Result;
import com.bosssoft.setp.service.LoginService;
import com.bosssoft.setp.service.RegisterService;
import com.bosssoft.setp.utils.CommonResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @className: RegisterController
 * @description:
 * 账号注册
 * @author: shixianwei
 * @date: 2024/8/16 14:55
 * @since 1.0
 **/

@CrossOrigin
@RequestMapping("/register")
@RestController
public class RegisterController {

    @Autowired
    private RegisterService registerService;



//        public ResponseEntity<String> logWithIdAndPassword(@NotNull @Valid  @RequestBody LoginDTO loginDTO) {
//        return CommonResponseUtils.success(loginService.logWithIdAndPassword(loginDTO));
//        //LoginVO loginVO = loginService.logWithIdAndPassword(loginDTO);
////        String result = loginService.logWithIdAndPassword(loginDTO);
////        return new ResponseEntity<>(, HttpStatus.OK);
    //}
    /**
     * 账号注册
     */
    @PostMapping(value = "/idpassword")
    public Result<Boolean> register(@NotNull @Valid @RequestBody RegisterDTO registerDTO){
        return Result.success(registerService.register(registerDTO));
    }


}

